package org.jctc.els.modules.biz.mapper.elsUserProject;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.jctc.els.modules.biz.entity.ElsUserProject.ElsUserProject;
import org.jctc.els.modules.biz.entity.elsTeamMembers.ElsTeamMembers;
import org.jctc.els.modules.biz.entity.elsTeamMembers.ElsTeamMembersVO;
import org.jctc.els.modules.biz.entity.user.User;
import org.jctc.els.modules.biz.vo.ElsUserProjectVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @author maxinyu
 * @title: ElsUserProjectMapper
 * @projectName evaluationsystem-boot
 * @description:
 * @date 2022/6/2110:09
 */
@Mapper
public interface ElsUserProjectMapper extends BaseMapper<ElsUserProject> {
    int selectUserProjectAlreadyExists(@Param("userId") Long userId,
                                       @Param("projectId") Long projectId);

    List<ElsUserProjectVO> getProjectsList(IPage<ElsUserProjectVO> page,
                                           @Param("teamId") String teamId,
                                           @Param("userId") String userId);

    void removeListByIds(@Param("id") Long id);

    ArrayList<ElsUserProject> selectProjectByUserId(@Param("userId") Long userId);

    //删除小组成员的项目
    int removeTeamMembersProject(@Param("teamId") Long teamId,
                                 @Param("userIds") List<Long> userIds);

    //删除小组成员的项目
    int removeTeamProjectsMember(@Param("teamId") Long teamId,
                                 @Param("projectIds") List<Long> projectIds);
}
